In the image processing field, a target in an image is generally detected and recognized in two stages of operations: partitioning and classification. As shown in FIG. 1, an image partitioning model receives an input image, and divides the input image into areas of different sizes. An image classification model continuously extracts features of each area of the image through a hierarchical structure using a convolutional neural network or other classification algorithms, to finally recognize a target object in the area.
In detecting and recognizing a target in an image, the partitioning operation and the classification operation have different performance requirements for processors. Currently, a heterogeneous platform is used for image recognition. For example, a “central processing unit (CPU)+graphics processing unit (GPU)” heterogeneous platform is used. A GPU is an easily programmable high-performance processor. Different from a CPU that is mainly used for data computation and instruction interpretation, a GPU is specifically designed for complex mathematical and geometrical computations, and is mainly used for graph and image processing. To fully use the computation performance of the CPU and the image processing performance of the GPU, a CPU+GPU heterogeneous platform is used for performing image recognition. The CPU is used first for image partitioning, and then the GPU is used for image classification.
However, in the heterogeneous platform, memories of processors of different types are independent of each other. For example, in the CPU+GPU heterogeneous platform, the CPU has an independent CPU memory, and the GPU also has an independent GPU memory (which is also referred to as a video RAM). Therefore, when the heterogeneous platform is used for target detection and recognition, data needs to be constantly exchanged between the heterogeneous processors (such as, between the CPU and the GPU). A large quantity of data exchange operations may cause a relatively long delay. Consequently, detection performance of the entire heterogeneous platform is affected.